package org.nimi317.web_gis.Enum;

import com.alibaba.fastjson2.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;

import java.util.Map;

/**
 * @author thunderobot
 */
@AllArgsConstructor
public enum DistanceEnum {
    EuclideanDistance(0, "欧几里得距离"),
    TaxicabDistance(1, "曼哈顿距离"),
    ChessboardDistance(2, "切比雪夫距离"),
    MinkowskiDistance(3, "闵可夫斯基距离");

    @EnumValue
    @JsonValue
    @JSONField
    private final int code;

    private final String value;

    public Map<?, ?> getObject() {
        return Map.of("code", this.code, "value", this.value, "desc", this.name());
    }
}
